<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8"/>
        <title><?php echo CHtml::encode($this->pageTitle); ?></title>
        <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->baseUrl; ?>/css/admin/reset.css" />
        <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->baseUrl; ?>/css/admin/frame.css" />
        <script type="text/javascript">
            function setHeight(){
            	if(document.getElementById("aside"))
                	document.getElementById("aside").style.height = document.documentElement.clientHeight + "px";
                if(document.getElementById("nav"))
                    document.getElementById("nav").style.height = document.documentElement.clientHeight - 32 + "px";
                if(document.getElementById("mask"))
                	document.getElementById("mask").style.height = document.documentElement.clientHeight + "px";
            };
            window.onload = setHeight;
            window.onresize = setHeight;
        </script>
    </head>
    <body>
        <div id="wrapper">
		
            <div class="main">
                <div id="main" class="main-cont">
                    <iframe src="<?php echo $this->createUrl('site/dashboard'); ?>" frameborder="0" width="100%" id="mask" name="mask" scrolling="yes"></iframe>
                </div>
            </div>

            <div id="aside">
                <h1 class="logo">
                    <a href="#" title="<?php echo CHtml::encode(Yii::app()->name); ?>"><?php echo CHtml::encode(Yii::app()->name); ?></a>
                </h1>
                <!-- /Logo -->
                <div id="nav" class="nav">
                    <?php $this->widget('zii.widgets.CMenu',array(
                        'encodeLabel'=>false,
                        'activateParents'=>true,
                        'items'=>array(
                            array('label'=>'Dashboard', 'url'=>array('/site/dashboard'), 'itemOptions'=>array('class'=>'active'), 'linkOptions'=>array('target'=>'mask')),
                            array('label'=>'Home Management', 'url'=>array('/home'), 'linkOptions'=>array('target'=>'mask')),
                            array('label'=>'Banner Management', 'url'=>array('/banner'), 'linkOptions'=>array('target'=>'mask')),
                            array('label'=>'Post Management', 'url'=>array('/post'), 'linkOptions'=>array('target'=>'mask')),
                            /*array('label'=>'Comments', 'url'=>array('/comment'), 'iterator_apply(iterator, function)ems'=>array(
                                array('label'=>'All comments', 'url'=>array('/comment/index')),
                                array('label'=>'Manage comments', 'url'=>array('/comment/admin')),
                                )),*/
                            array('label'=>'Product Management', 'url'=>array('/product'), 'linkOptions'=>array('target'=>'mask'), 'items'=>array(
                                array('label'=>'Products', 'url'=>array('/product'), 'linkOptions'=>array('target'=>'mask')),
                                array('label'=>'Categories', 'url'=>array('/category'), 'linkOptions'=>array('target'=>'mask')),
                                array('label'=>'Operation Systems', 'url'=>array('/os'), 'linkOptions'=>array('target'=>'mask')),
                                array('label'=>'Colors', 'url'=>array('/color'), 'linkOptions'=>array('target'=>'mask')),
                                array('label'=>'Displays', 'url'=>array('/display'), 'linkOptions'=>array('target'=>'mask')),
                                array('label'=>'Accessories', 'url'=>array('/accessory'), 'linkOptions'=>array('target'=>'mask')),
                                array('label'=>'Input/Output', 'url'=>array('/io'), 'linkOptions'=>array('target'=>'mask')),
                                array('label'=>'Languages', 'url'=>array('/language'), 'linkOptions'=>array('target'=>'mask')),
                                array('label'=>'Networks', 'url'=>array('/network'), 'linkOptions'=>array('target'=>'mask')),
                                array('label'=>'Sensors', 'url'=>array('/sensor'), 'linkOptions'=>array('target'=>'mask')),
                            )),
                        ),
                    )); ?>
                </div>
                <!-- /nav -->
            </div>
            
        </div>
        <?php
            $cs = Yii::app()->clientScript;
            // $cs->registerCoreScript('jquery');
            $cs->registerScriptFile(Yii::app()->baseUrl.'/js/jquery.js', CClientScript::POS_END);
            $cs->registerScript('navToggle', "
                $(function(){
                    $('#nav li').click(function(e){
                        $('.active').removeClass('active');
                        $(this).addClass('active')
                            .parents('li').addClass('active');
                        e.stopPropagation();
                    });
                });
            ", CClientScript::POS_END);
        ?>
    </body>
</html>         
